package com.zhumo.sz.mapper;

import com.zhumo.sz.entity.bike.SharedBikeOrderDetail;
import com.zhumo.sz.provider.BatchInsertProvider;
import com.zhumo.sz.provider.BatchNestCorrespondentProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

import java.util.List;

@Mapper
public interface BikeMapper {

    /**
     * 插入共享单车信息
     */
    @InsertProvider (type = BatchNestCorrespondentProvider.class,method = "batchInsert")
    int insertSubwayTraffic(@Param("list") List<SharedBikeOrderDetail> bikeOrderDetailList);

    /**
     * 当天所有订单  共享单车订单号码
     */
    @Select("select order_id from shared_bike_order_detail where DATE(create_time) < #{day};")
    List<String> selectBikeOrderByDate(@Param("day") String day);

}
